﻿ var re1=/[^!@#\$%\^\*\(\)\+\,\:\;\&\.\{\}\[\]\?\>\<]*$/;
 var re = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
 var regFlag=-1;
function SaveReg()
{    
    if(!$ValidButton$()||($('MemberCrtNo').value=="")||$("MemberCrtNo").value.search(re)||$('NickName').value.search(re1)||$('NickName').value==""||$('Password').value.length<6||$('Password').value=="")
    {
       
        if($('MemberCrtNo').value==""||$("MemberCrtNo").value.search(re))
        {
            $('RMemberCrtNo').style.display='';
            $('imgemail').style.display='';
            $('imgemail').src="/Images/action_delete.gif" ;
        }
        if($('Password').value.length<6||$('Password').value=="")
        {
            $('RPassword').style.display="";
            $('iPassword').style.display='';
            $('iPassword').src="/Images/action_delete.gif" ;
        }
        if($('NickName').value.search(re1)||$('NickName').value=="")
        {
            $('RNickName').style.display="";
            $('iNickName').style.display='';
            $('iNickName').src="/Images/action_delete.gif" ;
        }
        return;
    }
    showProgressBar(true);
    var timezone=new Date();   
    timezone=-timezone.getTimezoneOffset();
    $("timezone").value=timezone;
    $("Flag").value="1";
    $('re_ra').value=(re_ra*2*3);
    var dat=new Date();
    if(regFlag==-1&&((dat-re_dt)>2000))
    {   
        regFlag=1;
        $("Form1").submit();
     }
}

 
 function show(a)
{
 $(a).style.display=""; 

}
function conceal(a)
{
if(typeof(a) != "undefined"){
$(a).style.display="none"; 
}
if(a=='sMemberCrtNo')
{
$('RMemberCrtNo').style.display="none";
 $('imgemail').src="/Images/loading.gif" ;
$('imgemail').style.display="";
 if($("MemberCrtNo").value.search(re))
 {
     $('RMemberCrtNo').innerHTML=C1014;
    $('RMemberCrtNo').style.display=""; 
     $('imgemail').src="/Images/action_delete.gif" ;
    return;
}else
{
  WebServices.My.ValiEmail($('MemberCrtNo').value,onsucc1);
  }  
}
else if(a=='sPassword')
{
    $('RPassword').style.display="none";
    $('iPassword').src="/Images/loading.gif" ;
    $('iPassword').style.display="";
  if($('Password').value.length<6||$('Password').value=="")
  {
    $('RPassword').style.display="";
    $('iPassword').src="/Images/action_delete.gif" ;
    return;
  }
   $('iPassword').src="/Images/action_check.gif" ;
}else if(a=='sNickName')
{
    $('RNickName').style.display="none";
     $('iNickName').src="/Images/loading.gif" ;
    $('iNickName').style.display="";
  if($('NickName').value.search(re1)||$('NickName').value=="")
  {
  if($('NickName').value=="")
  {
    $('RNickName').innerHTML=UR042;
  }else if($('NickName').value.search(re1))
  {
    $('RNickName').innerHTML=C1016;
  }
    $('RNickName').style.display="";
    $('iNickName').src="/Images/action_delete.gif" ;
    return;
  }
   $('iNickName').src="/Images/action_check.gif" ;
}
}
function onsucc1(result)
{
    if(result==1)
    {
       $('imgemail').src="/Images/action_delete.gif" ;
       $('RMemberCrtNo').style.display="";
       $('RMemberCrtNo').innerHTML=UR018
    }else if(result==2)
    {
        $('imgemail').src="/Images/action_stop.gif" ;
        $('RMemberCrtNo').style.display="";
        $('RMemberCrtNo').innerHTML=BUSY;
    } else if(result==0)
    {
        $('imgemail').src="/Images/action_check.gif" ;
    }
    return;
}
function SetFlag(result)
 {
 if(result=="")
 {
    return;
 }
 else if(result=="1")
  {
        $("MessagesBox").style.display='';
        $("MessageImg").src = MessageImageF;
        $("MessageText").innerHTML = Codeerror;
  }
  else if(result=="-1")
  {
        $("MessagesBox").style.display='';
        $("MessageImg").src = MessageImageF;
        $("MessageText").innerHTML = Busy;
  }
  else if(result=="0")
  {
        $("MessagesBox").style.display='';
        $("MessageImg").src = MessageImageF;
        $("MessageText").innerHTML = Emailrepeat;
  }

    document.getElementById('Password').value="";

    showProgressBar(false);   
 }

